<?php
namespace app\admin\model;

use think\Model;

class Guestbook extends Model
{
    protected $insert  = ['uid'];
    
    public function member()
    {
        return $this->hasOne('Member', 'id', 'uid')->field('id, username');
    }

    public function getStatusTurnAttr($value, $data)
    {
        $turnArr = [0=>lang('status0'), 1=>lang('status1')];
        return $turnArr[$data['status']];
    }
}